3.1.29 \(\int \frac {\csc (x)}{a+b \cos (x)} \, dx\) [29]

Optimal. Leaf size=53 \[ \frac {\log (1-\cos (x))}{2 (a+b)}-\frac {\log (1+\cos (x))}{2 (a-b)}+\frac {b \log (a+b \cos (x))}{a^2-b^2} \]

[Out]

1/2*ln(1-cos(x))/(a+b)-1/2*ln(cos(x)+1)/(a-b)+b*ln(a+b*cos(x))/(a^2-b^2)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {2747, 720, 31, 647} \begin {gather*} \frac {b \log (a+b \cos (x))}{a^2-b^2}+\frac {\log (1-\cos (x))}{2 (a+b)}-\frac {\log (\cos (x)+1)}{2 (a-b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x]/(a + b*Cos[x]),x]

[Out]

Log[1 - Cos[x]]/(2*(a + b)) - Log[1 + Cos[x]]/(2*(a - b)) + (b*Log[a + b*Cos[x]])/(a^2 - b^2)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 647

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[(-a)*c, 2]}, Dist[e/2 + c*(d/(2*q)),
Int[1/(-q + c*x), x], x] + Dist[e/2 - c*(d/(2*q)), Int[1/(q + c*x), x], x]] /; FreeQ[{a, c, d, e}, x] && NiceS
qrtQ[(-a)*c]

Rule 720

Int[1/(((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[e^2/(c*d^2 + a*e^2), Int[1/(d + e*x), x],
 x] + Dist[1/(c*d^2 + a*e^2), Int[(c*d - c*e*x)/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a
*e^2, 0]

Rule 2747

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {\csc (x)}{a+b \cos (x)} \, dx &=-\left (b \text {Subst}\left (\int \frac {1}{(a+x) \left (b^2-x^2\right )} \, dx,x,b \cos (x)\right )\right )\\ &=\frac {b \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \cos (x)\right )}{a^2-b^2}+\frac {b \text {Subst}\left (\int \frac {-a+x}{b^2-x^2} \, dx,x,b \cos (x)\right )}{a^2-b^2}\\ &=\frac {b \log (a+b \cos (x))}{a^2-b^2}+\frac {\text {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \cos (x)\right )}{2 (a-b)}-\frac {\text {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \cos (x)\right )}{2 (a+b)}\\ &=\frac {\log (1-\cos (x))}{2 (a+b)}-\frac {\log (1+\cos (x))}{2 (a-b)}+\frac {b \log (a+b \cos (x))}{a^2-b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 50, normalized size = 0.94 \begin {gather*} \frac {(a-b) \log (1-\cos (x))-(a+b) \log (1+\cos (x))+2 b \log (a+b \cos (x))}{2 (a-b) (a+b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]/(a + b*Cos[x]),x]

[Out]

((a - b)*Log[1 - Cos[x]] - (a + b)*Log[1 + Cos[x]] + 2*b*Log[a + b*Cos[x]])/(2*(a - b)*(a + b))

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 54, normalized size = 1.02

method result size
norman \(\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{a +b}+\frac {b \ln \left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+a +b \right )}{a^{2}-b^{2}}\) \(47\)
default \(\frac {b \ln \left (a +b \cos \left (x \right )\right )}{\left (a -b \right ) \left (a +b \right )}+\frac {\ln \left (-1+\cos \left (x \right )\right )}{2 a +2 b}-\frac {\ln \left (\cos \left (x \right )+1\right )}{2 a -2 b}\) \(54\)
risch \(\frac {i x}{a -b}-\frac {i x}{a +b}-\frac {2 i x b}{a^{2}-b^{2}}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{a -b}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{a +b}+\frac {b \ln \left ({\mathrm e}^{2 i x}+\frac {2 a \,{\mathrm e}^{i x}}{b}+1\right )}{a^{2}-b^{2}}\) \(101\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)/(a+b*cos(x)),x,method=_RETURNVERBOSE)

[Out]

b/(a-b)/(a+b)*ln(a+b*cos(x))+1/(2*a+2*b)*ln(-1+cos(x))-1/(2*a-2*b)*ln(cos(x)+1)

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 47, normalized size = 0.89 \begin {gather*} \frac {b \log \left (b \cos \left (x\right ) + a\right )}{a^{2} - b^{2}} - \frac {\log \left (\cos \left (x\right ) + 1\right )}{2 \, {\left (a - b\right )}} + \frac {\log \left (\cos \left (x\right ) - 1\right )}{2 \, {\left (a + b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)),x, algorithm="maxima")

[Out]

b*log(b*cos(x) + a)/(a^2 - b^2) - 1/2*log(cos(x) + 1)/(a - b) + 1/2*log(cos(x) - 1)/(a + b)

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 52, normalized size = 0.98 \begin {gather*} \frac {2 \, b \log \left (-b \cos \left (x\right ) - a\right ) - {\left (a + b\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left (a - b\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} - b^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)),x, algorithm="fricas")

[Out]

1/2*(2*b*log(-b*cos(x) - a) - (a + b)*log(1/2*cos(x) + 1/2) + (a - b)*log(-1/2*cos(x) + 1/2))/(a^2 - b^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc {\left (x \right )}}{a + b \cos {\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)),x)

[Out]

Integral(csc(x)/(a + b*cos(x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 54, normalized size = 1.02 \begin {gather*} \frac {b^{2} \log \left ({\left | b \cos \left (x\right ) + a \right |}\right )}{a^{2} b - b^{3}} - \frac {\log \left (\cos \left (x\right ) + 1\right )}{2 \, {\left (a - b\right )}} + \frac {\log \left (-\cos \left (x\right ) + 1\right )}{2 \, {\left (a + b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)),x, algorithm="giac")

[Out]

b^2*log(abs(b*cos(x) + a))/(a^2*b - b^3) - 1/2*log(cos(x) + 1)/(a - b) + 1/2*log(-cos(x) + 1)/(a + b)

________________________________________________________________________________________

Mupad [B]
time = 0.21, size = 52, normalized size = 0.98 \begin {gather*} \frac {\ln \left (\cos \left (x\right )-1\right )}{2\,\left (a+b\right )}-\frac {\ln \left (\cos \left (x\right )+1\right )}{2\,\left (a-b\right )}+\frac {b\,\ln \left (a+b\,\cos \left (x\right )\right )}{a^2-b^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)*(a + b*cos(x))),x)

[Out]

log(cos(x) - 1)/(2*(a + b)) - log(cos(x) + 1)/(2*(a - b)) + (b*log(a + b*cos(x)))/(a^2 - b^2)

________________________________________________________________________________________